/**
 * 
 */
package org.softTank.BC.rs.resource;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.UriInfo;

import org.softTank.BC.manager.CategoryManager;
import org.softTank.BC.rs.bean.TypeBean;

/**
 * @author Yuzone
 *
 */
@Path("/type")
public class TypeResource {

	@Context
	UriInfo uriInfo;
	@Context
	Request request;

	@GET
	@Produces(MediaType.APPLICATION_XML)
	public List<TypeBean> getAllType() {
		return new CategoryManager().getTypes();
	}

	@Path("/{typeID}/category")
	public CategoryResource getCategoryInfo() {
		return new CategoryResource();
	}

	@Path("/{typeID}/category/{categoryID}/service")
	public ServiceResource getServiceInfo(@PathParam("typeID") String typeID,
			@PathParam("categoryID") String categoryID) {
		return new ServiceResource(typeID, categoryID);
	}

	@Path("/{typeID}/category/{categoryID}/service/{serviceID}/operation")
	public OperationResource getOperationInfo(
			@PathParam("serviceID") String serviceID) {
		return new OperationResource(serviceID);
	}
}
